/*mulfunc.c*/
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
void clean_1(void *arg)
{
    printf("%s\n", (char *)arg);
}
void *t1_execute(void *arg)
{
    pthread_cleanup_push(clean_1, "thread  first handler");
    pthread_cleanup_push(clean_1, "thread  second hadler");

    if (*(int *)arg == 1)
        printf("abc\n");
    else
        exit(0);
    pthread_cleanup_pop(0);
    pthread_cleanup_pop(0);
}
void main()
{
    pthread_t pid1;
    int error1;
    int i = 1;
    error1 = pthread_create(&pid1, NULL, t1_execute, (void *)&i);
    if (error1 != 0)
    {
        printf("pthread_create failed ");
        return;
    }
    pthread_join(pid1, NULL);
    return;
}